package exam.bak.ali;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class P1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = Integer.parseInt(scanner.nextLine().trim());
        String paintStr = scanner.nextLine().trim();
        System.out.println(solve(paintStr));
    }

    private static int solve(String s) {
        Map<Character, Integer> map = new HashMap<>();
        map.put('B', 0);
        map.put('R', 0);
        for (int i = 1; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c != s.charAt(i - 1)) {
                map.put(c, map.get(c));
            }
        }

        if (map.get('B') == 0 || map.get('R') == 0) {
            return 1;
        }
        return 1 + Math.min(map.get('B'), map.get('R'));
    }
}
